Implementing opaque fields#8
Merged
Merged
Conversation
thrau
approved these changes
Nov 7, 2025
Member
There was a problem hiding this comment.
i like this approach! i didn't actually know about typing.Annotated, nice find! i love that there's still things to learn about python :D
we should give this a try, but i'd love to see a concrete example from localstack soon so we can decide whether this is the way forward.
remember that these types of changes will proliferate through the entire codebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In our application, we might want to "disable" Avro schema for some fields.
Unfortunately, we can't completely ignore a field (similar to what
transientdoes in the Java world) but we can simply tell Avro to serialize everything to a string.We introducing the type
Opaquethat, used in combination withAnnotated, tellspy-avroreduce everything to a string.For this to work end-to-end, we need to implement a similar logic in our
ObjectSerializer(see comment below).💡 : we have being adding features working across this repo and the mapper component in LocalStack. In the future, we might want to either have an external comprehensive library with both components, or internalize everything.
Related to PNX-443